<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>流程历史信息</title>
<script type="text/javascript">
</script>
</head>

<body class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'north',split: true, collapsible:true"
		style="padding: 10px; height: 250px;overflow-x:hide;overflow-y:auto;">
		<img
			src="${ctx}/bpm/confForm/task-graphHistoryProcessInstance?processInstanceId=${processInstanceId}"/>
	</div>
	<div data-options="region:'center',split: false, collapsible:false">
			<table id="historyTaskListGrid"  class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
					<th>任务编号</th>
					<th>任务名字</th>
					<th>任务执行人</th>	
					<th>是否同意</th>
					<th>审批意见</th>
					<th>处理结果</th>
					<th>开始时间</th>
					<th>结束时间</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${opinions}" var="item">
						<tr>
							<td>${item.historicTaskInstance.id}</td>
							<td>${item.historicTaskInstance.name}</td>
							<td><tags:user
									userId="${item.historicTaskInstance.assignee}" /></td>
							<c:choose>
								<c:when test="${item.operate=='是'}">
								<td><span class="label label-sm label-success">${item.operate}</span></td>
								</c:when>
								<c:when test="${item.operate=='否'}">
									<td><span class="label label-sm label-danger">${item.operate}</span></td>
								</c:when>
								<c:otherwise><td></td></c:otherwise>
							</c:choose>							
							<td>${item.opinion}</td>
							<c:choose>
								<c:when test="${not empty item.historicTaskInstance.deleteReason}">
									<td><span class="label label-sm label-success">${item.historicTaskInstance.deleteReason}</span></td>
								</c:when>
								<c:otherwise><td><span class="label label-sm label-primary">待办</span></td></c:otherwise>
							</c:choose>								
							<td><fmt:formatDate
									value="${item.historicTaskInstance.startTime}"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td><fmt:formatDate
									value="${item.historicTaskInstance.endTime}"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
							
						</tr>
					</c:forEach>
				</tbody>
			</table>
	</div>
</body>
</html>
